import {
    ADD_COUNTER,
    ADD_TO_CART
} from "./mutations-types"


export default {
    //mutations唯一的目的就是为了修改state的状态
    //mutations中每个方法完成的功能尽可能比较单一
    [ADD_COUNTER](state, payload) {
        payload.count++;
    },
    [ADD_TO_CART](state, payload) {
        payload.check = true
        state.cartList.push(payload)
    }
}